db.robot_MoveCtrlArgumentInfo.aggregate([
    { $match: 
        { 
            createDate: { $gte : new ISODate("2019-04-07T16:00:00.000Z"), $lt : new ISODate("2019-04-14T16:00:00.000Z") }, 
            schoolName: { $nin: ["金庸武侠幼儿园","谛达诺幼儿园","明天幼儿园"]  }
        } 
    },
    { $group: { _id: "$deviceNo", count: { $sum: 1 } } },
    { $group: { _id: "count", count: { $sum: 1 } } }
])

db.robot_MoveCtrlArgumentInfo.aggregate([
    { $match: 
        { 
            createDate: { $gte : new ISODate("2019-04-07T16:00:00.000Z"), $lt : new ISODate("2019-04-14T16:00:00.000Z") }, 
            schoolName: { $nin: ["金庸武侠幼儿园","谛达诺幼儿园","明天幼儿园"]  }
        } 
    },
    { $group: { _id: "$deviceNo", codeMileage: { $sum: "$codeMileage" } } },
    { $group: { _id: "count", count: { $sum: '$codeMileage' } } }
]) 
    
db.robot_MoveCtrlArgumentInfo.aggregate([
    { $match: 
        { 
            createDate: { $gte : new ISODate("2019-04-07T16:00:00.000Z"), $lt : new ISODate("2019-04-14T16:00:00.000Z") }, 
            schoolName: { $nin: ["金庸武侠幼儿园","谛达诺幼儿园","明天幼儿园"]  },
            codeMileage: { $ne: "", $exists: true }
        } 
    },
    { $group: { _id: "count", codeMileage: { $sum: 1 } } },
]) 

db.robot_MoveCtrlArgumentInfo.aggregate([
    { $match: 
        { 
            createDate: { $gte : new ISODate("2019-04-07T16:00:00.000Z"), $lt : new ISODate("2019-04-14T16:00:00.000Z") }, 
            schoolName: { $nin: ["金庸武侠幼儿园","谛达诺幼儿园","明天幼儿园"]  }
        } 
    },
    { $group: { _id: "$deviceNo", codeMileage: { $max: "$codeMileage" } } },
    { $group: { _id: "count", count: { $sum: '$codeMileage' } } }
]) 